#include<iostream>
#include<cerrno>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include<vector>
#include<sys/types.h>
#include<sys/stat.h>
#include<assert.h>
#include<fcntl.h>
#include<sys/wait.h>

using namespace std;

const string str = "./fifo";
mode_t m = 0666;

#define NUM 1024
#define MAX 3

typedef void (*fun_c)();

void PrintLog()
{
  cout << "正在执行打印日志的任务" << endl; 
}

void InsertMySQL()
{
  cout << "正在执行数据库输入的任务" << endl;
}

void NetQuest()
{
  cout << "正在执行网络请求的任务" << endl;
}

class Task
{
public:
  Task()
  {
    taskbar.push_back(PrintLog);
    taskbar.push_back(InsertMySQL);
    taskbar.push_back(NetQuest);
  }
  void Excute(int command)
  {
    if(command >= 0 || command <= 2) taskbar[command]();
  }
private:
  vector<fun_c> taskbar; 
};


